﻿namespace MovieTracker.Catalog
{
    using System.ComponentModel.Composition;

    using Common.NetFlixService;

    using MovieTracker.Common.Contracts.Catalog;

    using Refract.Composition;
    using Refract.OData;

    [Export(typeof(IGenreService))]
    public class GenreService : ReadOnlyODataService<NetflixCatalog, Genre, GenreModel, GenreList, GenreListModel>, IGenreService
    {
        #region Constructors

        public GenreService()
            : base(null)
        {
            Context = Container.Current.GetExportedValue<NetflixCatalog>();
        }

        public GenreService(NetflixCatalog context)
            : base(context)
        {
        }

        #endregion Constructors

        #region Methods

        public override GenreListModel GetList()
        {
            return GetListInternal(Context.Genres);
        }

        #endregion Methods
    }
}